<%--
    Document   : form_konfirmasi.jsp
    Created on : Nov 9, 2012, 5:27:45 PM
    Author     : Rico
--%>

<%@page import="bunga.KaranganBunga"%>
<%
            bunga.KoneksiDatabase conn = new bunga.KoneksiDatabase();
%>
<%@page import="java.sql.Statement"%>

<html xmlns="http://www.w3.org/1999/xhtml">
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>Confirmation</title>
    <link href='http://fonts.googleapis.com/css?family=Oswald:400,300' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Abel|Satisfy' rel='stylesheet' type='text/css'>
    <link href="style.css" rel="stylesheet" type="text/css" media="screen" />


    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>Form konfirmasi</title>
        </head>
        <body>
            <div id="wrapper">
                <div id="header-wrapper">
                    <div id="header" class="container">
                        <div id="menu">
                            <ul>
                                <li><a href="home.jsp" class="selected">Home</a></li>
                                <li><a href="aboutUs.jsp" class="selected">About Us</a></li>
                                <li><a href="ourLocation.jsp" class="selected">Our Location</a></li>
                                <li><a href="cek_status.jsp">Cek Status Pesanan</a></li>
                            </ul>
                        </div>
                    </div>
                    <div id="banner">
                        <div class="content"><img src="images/header.jpg" width="1000" height="220" alt="" /></div>
                    </div>
                </div>

            </div>
            <div>
                <td>
                    <center>
                        <%
                                    String kode = session.getAttribute("noBunga").toString();
                                    String tipe = new KaranganBunga().getTeks(kode);
                                    int jumlah = Integer.parseInt(session.getAttribute("jumlah").toString());
                                    double harga = KaranganBunga.getNPrice(kode, tipe);
                                    double total = jumlah * harga;
                        %>
                        <table border="1">
                            <tr>

                                <td>Tipe</td>
                                <td>Jumlah</td>
                                <td>Harga</td>
                                <td>Total</td>
                            </tr>
                            <tr>

                                <td><%= tipe%></td>
                                <td><%= jumlah%></td>
                                <td><%= harga%></td>
                                <td><%=total%></td>
                            </tr>

                        </table>
                        <%
                                    try {
                                        String query = "SELECT * FROM dataPesanan where idPesanan =(select max(idPesanan) from dataPesanan)";
                                        java.sql.Statement statement = conn.getDBConnection().createStatement();
                                        java.sql.ResultSet result = statement.executeQuery(query);

                                        while (result.next()) {
                                            out.println("<br><center><b>");
                                            out.println("Data Pemesan" + "<br></center></b>");
                                            out.println("Kode Pesanan  : " + result.getString("idPesanan") + "<br>");
                                            out.println("Nama          : " + result.getString("namaPemesan") + "<br>");
                                            out.println("Alamat        : " + result.getString("alamatPemesan") + "<br>");
                                            out.println("Email         : " + result.getString("email") + "<br>");
                                            out.println("Telepon       : " + result.getString("teleponPemesan") + "<br>");

                                            out.println("<br><center><b>");
                                            out.println("Data Penerima" + "<br></center></b>");
                                            out.println("Nama           : " + result.getString("namaPenerima") + "<br>");
                                            out.println("Tanggal Kirim  : " + result.getString("tglKirim") + "<br>");
                                            out.println("Jam Kirim      : " + result.getString("jamKirim") + "<br>");
                                            out.println("Alamat         : " + result.getString("alamatPemesan") + "<br>");
                                            out.println("Telepon        : " + result.getString("teleponPemesan") + "<br>");
                                            out.println("Ucapan         : " + result.getString("ucapan") + "<br>");
                                        }
                                        statement.close();
                                    } catch (Exception ex) {

                                        out.println("message: " + ex.getMessage());
                                    }

                        %>
                    </center></td>


            </div>
            <div id="footer">
                <p>Copyright (c) 2012. All rights reserved.<br />Designed & Developed by <a href="http://www.facebook.com/yulius.ferdian" target="_blank">Yulius</p>
            </div>
        </body>
    </html>
